import React, { Component, PureComponent } from 'react'

export default class RandomReact extends PureComponent {
  state={
    num:0
  }
  render() {
    console.log('---RandomReact的render---');
    return (
      <div>
        <div>{this.state.num}</div>
        <button onClick={()=>{
            this.setState({
                num:Math.floor(Math.random()*3)
            })
        }}>更新</button>
      </div>
    )
  }
}
